package main.java.pers.seg.model.utils;


import org.dom4j.Attribute;
import org.dom4j.Element;

import static main.java.pers.seg.model.constants.StringConstants.scrollEvent;

public class RuleUtils {

    /**
     * 判断隐性规则
     * @param ifmlElement
     */
    public static void  implicitJudge(Element gatornode,Element ifmlnode,Element ifmlElement,String type){
        if(type.equals("org.asdtm.goodweather.MainActivity")){
            ifmlElement.addAttribute("isDefault", "true");
        }
        if(type.equals("android.support.design.widget.NavigationView")){
            ifmlElement.addAttribute("isWindow", "true");
        }
        if(type.equals("android.support.v4.widget.SwipeRefreshLayout")){
            Element ifElement = ifmlnode.addElement("viewElementEvents");
            ifElement.addAttribute("xsi:type", scrollEvent);
            ifElement.addAttribute("name", gatornode.attributeValue("idName"));
            ifmlnode = ifElement;
        }

    }

    public static void uncommonRule(Element gatornode) {

    }
}
